package com.xinqi.test;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.Executor;

/**
 * @author xin麒
 * @date 2023/8/14 16:57
 */
@Slf4j
public class XinQiTask {
    public void executeTaskByExecutor(Executor executor, int taskIndex) {
        executor.execute(() -> {
            log.debug("{taskIndex} time start this task in Pool");
            try {
                Thread.sleep(1000 * 10);
            } catch (InterruptedException e) {
                log.debug("the InterruptedException is shows on {taskIndex}_task when i am sleeping");
            }
            log.debug("{taskIndex} time end this task in Pool");
        });
    }
}
